import request from '@/utils/request'

export function getdetail(id) {
  return request({
    url: `/expertRegistry/getexpert/${id}`,
    method: 'get'
  })
}

export function downpdf(id,data) {
  return request({
    url: `/projectReview/reviewMeeting/pdf/${id}`,
    method: 'post',
    data,
    responseType: 'blob'
  })
}

export function uploadfile(data) {
  return request({
    url: `/projectReview/reviewChange/upload`,
    method: 'post',
    data
  })
}
export function getReviewChangefile(id) {
  return request({
    url: `/projectReview/reviewChange/file-info/${id}`,
    method: 'get'
  })
}
export function downloadfile(data) {
  return request({
    url: `/admin/common/download`,
    method: 'get',
    params:data,
    responseType: 'blob'
  })
}

export function getExpertBasicInfo(userId) {
  return request({
    url: `/admin/expertBasicInfo/getByUserId/${userId}`,
    method: 'get'
  })
}

export function addOrUpdateExpert(data) {
  return request({
    url: '/admin/expertBasicInfo/addOrUpdateExpert',
    method: 'post',
    data
  })
}

// 附件上传相关接口
export function uploadAttachments(formData) {
  return request({
    url: '/admin/expertAttach/addOrUpdate',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

export function getAttachmentsByExpertId(expertId) {
  return request({
    url: `/admin/expertAttach/get/${expertId}`,
    method: 'get'
  })
}
